Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

repeat-element

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repeat-element

Create an array by repeating the given value n times.

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.4M
decreased by-45.61%
Maintainers
1
Weekly downloads
 
Created

What is repeat-element?

The repeat-element npm package is a simple utility that allows you to create an array of repeated values. It is useful when you need to generate a list with the same value multiple times without manually writing out each element.

What are repeat-element's main functionalities?

Repeat a single value

This feature allows you to repeat a single value a specified number of times to create an array. The first argument is the value to repeat, and the second argument is the number of times to repeat it.

var repeat = require('repeat-element');
var repeatedArray = repeat('a', 5);
// repeatedArray is ['a', 'a', 'a', 'a', 'a']

Other packages similar to repeat-element

Keywords

FAQs

Package last updated on 07 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc